how to check if a string contains a substring in javascript